home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / security / log_tcp_6.0alpha.shar / Makefile.dist < prev    next >
Encoding:
Makefile  |  1993-07-02  |  16.0 KB  |  403 lines

  1. # @(#) Makefile.dist 1.3 93/07/02 16:33:31
  2. # If you did not already do so, copy the file Makefile.dist to Makefile
  3. # and edit the copy, not the original. Have a copy of the README file at
  4. # hand while editing. It gives some additional background.
  5. #
  6. # For your convenience, all configurable parameters have been moved into
  7. # the Makefile, so that you do not have to hack the source files anymore.
  8. #
  9. # Some parameters must always be set to match the operating environment.
  10. # Other parameter settings are a matter of taste. Their sections headings
  11. # are labeled "(Optional)". The defaults correspond to the programs as
  12. # documented in the manual pages.
  13.  
  14. ######################################################
  15. # Choice between easy and advanced installation recipe
  16. # According to the easy installation recipe in the README file, vendor-
  17. # provided network daemons are moved to "some other" directory, and the
  18. # tcpd wrapper fills in the "holes". For this mode of operation, the
  19. # REAL_DAEMON_DIR macro should be set to the "some other" directory.
  20. # Uncomment the appropriate line. The "..." is here for historical
  21. # reasons only; you will probably want to use some other name. Watch out
  22. # for the quotes and backslashes.
  23.  
  24. REAL_DAEMON_DIR=\"/usr/etc/...\"    # BSD 4.3 Ultrix 4.x SunOS 4.x
  25. #REAL_DAEMON_DIR=\"/usr/sbin/...\"    # SysV.4 Solaris 2.x
  26. #REAL_DAEMON_DIR=\"/usr/libexec/...\"    # BSD 4.4
  27.  
  28. # According to the advanced installation recipe, vendor-provided daemons
  29. # are left alone, and the inetd file is edited instead. In that case, the
  30. # REAL_DAEMON_DIR macro should reflect the actual directory with (most of)
  31. # your vendor-provided network daemons.  Uncomment the appropriate line.
  32.  
  33. #REAL_DAEMON_DIR=\"/usr/etc\"        # BSD 4.3 Ultrix 4.x SunOS 4.x
  34. #REAL_DAEMON_DIR=\"/usr/sbin\"        # SysV.4 Solaris 2.x
  35. #REAL_DAEMON_DIR=\"/usr/libexec\"    # BSD 4.4
  36.  
  37. ##########################################
  38. # TLI (transport-level interface) support.
  39. # TLI provides an alternative, protocol-independent, network programming
  40. # interface.  When TCP/IP is used underneath TLI, the daemon wrappers
  41. # provide the same fuctionality as with socket-based applications. When
  42. # some other protocol is used underneacth TLI, functionality will be
  43. # reduced (unpredictable network address strings, no remote username
  44. # lookup, no net/mask access control patterns), but it is still better
  45. # than knowing nothing at all.
  46. # Uncomment the following macro if your system has System V.4-style TLI
  47. # support (/usr/include/sys/timod.h, /etc/netconfig, and the netdir(3)
  48. # routines).
  49. #
  50. #TLI    = -DTLI
  51.  
  52. #########################################################
  53. # Differences between ranlib(1) and ar(1) implementations
  54. #
  55. # Some C compilers (Ultrix 4.x) insist that ranlib(1) be run on an object
  56. # library; some don't care as long as the modules are in the right order;
  57. # some systems don't even have a ranlib(1) command. SGI IRIX uses the 's'
  58. # option to the 'ar' command instead. Make your choice.
  59.  
  60. RANLIB    = ranlib    # have ranlib (BSD-ish UNIX)
  61. #RANLIB    = echo        # no ranlib (SYSV-ish UNIX)
  62.  
  63. ARFLAGS    = rv        # OK for most systems
  64. #ARFLAGS= rvs        # ranlib flag for 'ar' on IRIX 4.0.x
  65.  
  66. #######################################################
  67. # Routines that are not present in the system libraries
  68. # The strcasecmp.c file provided with this package comes from 4.3+BSD
  69. # UNIX. The setenv.c module is a re-implementation of the 4.4 BSD one.
  70. # strtok.c comes from 4.4BSD. 
  71.  
  72. AUX_OBJ    = setenv.o            # no setenv(3)
  73. #AUX_OBJ= setenv.o strcasecmp.o        # no setenv(3) and no strcasecmp(3)
  74. #AUX_OBJ= setenv.o strcasecmp.o strtok.o
  75.  
  76. # While building the file strcasecmp.o, the compiler may complain that
  77. # u_char is undefined. Uncomment the following definition for a fix.
  78. #
  79. #UCHAR    = -Du_char="unsigned char"    # no u_char type
  80.  
  81. # Uncomment the following if your C library has index/rindex/bcmp
  82. # but does not provide the strchr/strrchr/memcmp routines. If that
  83. # is the case, you probably also do not have strtok() (see above).
  84. #
  85. #STRINGS= -Dindex=strchr -Drindex=strrchr -Dmemcmp=bcmp
  86.  
  87. ###########################################
  88. # Selection of non-default object libraries
  89. #
  90. # Many System-V versions require that you explicitly specify the networking
  91. # libraries (for example, -lnet or -linet).
  92. #
  93. #LIBS    = -lsocket -lnsl    # SysV.4 Solaris 2.x
  94. #LIBS    = -lsun            # IRIX
  95.  
  96. #########################
  97. # Ultrix-specific section
  98. #
  99. # Ultrix users may want to use the miscd wrapper, too. The Ultrix miscd
  100. # implements among others the SYSTAT service which runs the WHO command,
  101. # and thus provides a subset of the finger service. The very first wrapper
  102. # application (in the early hours of May 20, 1990) was to monitor SYSTAT.
  103.  
  104. all:    tcpd try            # no Ultrix miscd
  105. #all:    tcpd try miscd            # Ultrix, monitor systat etc. too
  106.  
  107. #REAL_MISCD=\"/usr/etc/.../miscd\"    # easy installation
  108. #REAL_MISCD=\"/usr/etc/miscd\"        # advanced installation
  109.  
  110. ################################
  111. # System-specific compiler flags
  112. #
  113. # Apollo Domain/OS offers both bsd and sys5 environments, sometimes
  114. # on the same machine.  If your Apollo is primarily sys5.3 and also
  115. # has bsd4.3, uncomment the following to build under bsd and run under
  116. # either environment.
  117. #
  118. #SYSTYPE= -A run,any -A sys,any
  119.  
  120. # For MIPS RISC/os 4_52.p3, uncomment the following definition.
  121. #
  122. #SYSTYPE= -sysname bsd43
  123.  
  124. ############################
  125. # Working around system bugs
  126. #
  127. # Some versions of Apollo or SYSV.4 UNIX have a bug in the getpeername(2)
  128. # routine.  You may have this bug when the wrapper reports that all UDP
  129. # connections come from address 0.0.0.0. Compile with -DGETPEERNAME_BUG
  130. # for a workaround. The workaround does no harm on other systems. If in
  131. # doubt, leave it in.
  132. #
  133. # Some System V versions (Solaris 2) have a problem in the recvfrom()
  134. # emulation code.  You may have this bug when the wrapper programs
  135. # complain about "unexpected address family 0" when processing an UDP
  136. # request. Compile with -DRECVFROM_BUG for a workaround. The workaround
  137. # does no harm on other systems. If in doubt, leave it in.
  138. # With some System V implementations (SCO UNIX 3.2v4), even compiling
  139. # with -DRECVFROM_BUG does not solve the "address family 0" problem. If
  140. # that is the case, compile with -DADDRESS_FAMILY_BUG instead.
  141. #
  142. # DG/UX 5.4.1 comes with an inet_ntoa() function that returns a structure
  143. # instead of a long integer. Compile with -DINET_ADDR_BUG to work around
  144. # this mutant behavour.
  145.  
  146. BUGS    = -DGETPEERNAME_BUG -DRECVFROM_BUG # -DADDRESS_FAMILY_BUG
  147.  
  148. ####################################################
  149. # Whether or not your system has NIS (or YP) support
  150. #
  151. # If your system supports NIS or YP-style netgroups, enable the following
  152. # macro definition. Netgroups are used only for host access control.
  153. #
  154. #NETGROUP= -DNETGROUP
  155.  
  156. # End of the required configuration options; all other ones are optional.
  157. #########################################################################
  158.  
  159. ################################################################
  160. # Changing the default disposition of logfile records (Optional)
  161. #
  162. # By default, logfile entries are written to the same file as used for
  163. # sendmail transaction logs. See your /etc/syslog.conf file for actual
  164. # path names of logfiles. The tutorial section in the README file
  165. # gives a brief introduction to the syslog daemon.
  166. # Change the FACILITY definition below if you disagree with the default
  167. # disposition. Some syslog versions (including Ultrix 4.x) do not provide
  168. # this flexibility.
  169. # If nothing shows up on your system, it may be that the syslog records
  170. # are sent to a dedicated loghost. It may also be that no syslog daemon
  171. # is running at all. The README file gives pointers to surrogate syslog
  172. # implementations for systems that have no syslog library routines or
  173. # no syslog daemons.
  174. #
  175. # The LOG_XXX names below are taken from the /usr/include/syslog.h file.
  176.  
  177. FACILITY= LOG_MAIL    # LOG_MAIL is what most sendmail daemons use
  178.  
  179. # The syslog priority at which successful connections are logged.
  180.  
  181. SEVERITY= LOG_INFO    # LOG_INFO is normally not logged to the console
  182.  
  183. #############################################
  184. # Enabling remote username lookups (Optional)
  185. #
  186. # By default, the wrappers just report the remote host name (the host
  187. # address if the host name lookup fails or times out).  Username lookups
  188. # require that the remote host runs a daemon that supports a RFC 931 like
  189. # protocol.  Remote user name lookups are not possible for UDP-based
  190. # connections, and can cause noticeable delays with connections from
  191. # non-UNIX PCs.  On some systems, remote username lookups can trigger a
  192. # kernel bug, causing loss of service. The README file gives details on
  193. # how to find out if your system has that problem.
  194. # Uncomment the following definition if the wrappers should always
  195. # attempt to get the remote user name.
  196. #
  197. # The default username lookup timeout is 30 seconds.
  198. #
  199. #AUTH    = -DRFC931_TIMEOUT=30 -DRFC931
  200.  
  201. # The USER_AT_HOST feature does selective username lookups. It triggers
  202. # on access control patterns of the form xxx@yyy. Until now, such
  203. # patterns were not used, so that USER_AT_HOST does not break existing
  204. # rules.
  205. # The feature is not documented and is not yet intended for general use,
  206. # because it can complicate the design of access control tables.
  207. # With USER_AT_HOST enabled, remote username lookups are done only for
  208. # user_pattern@host_pattern expressions in the access control files, but
  209. # only when the host_pattern matches. Example: "ALL: @pcgroup ALL@ALL"
  210. # avoids user name lookups for members of the pcgroup netgroup.  The
  211. # user_pattern syntax is identical to that of host_pattern, but "ALL"
  212. # is usually the only user_pattern that makes sense.
  213. # The default username lookup timeout is 30 seconds.
  214. #
  215. #AUTH    = -DRFC931_TIMEOUT=30 -DUSER_AT_HOST
  216.  
  217. ########################################################
  218. # Turning on experimental language extensions (Optional)
  219. #
  220. # Instead of the officially documented access control language, the
  221. # software can be configured to implement a more experimental language
  222. # that is easily extended. The experimental language is implemented by
  223. # the "options.c" source module which also serves as its documentation.
  224.  
  225. STYLE    = -DOPTIONS_STYLE=shell_cmd        # The documented language
  226. #STYLE    = -DOPTIONS_STYLE=process_options    # The experimental one
  227.  
  228. ######################################################
  229. # Changing the default file protection mask (Optional)
  230. #
  231. # On many systems, network daemons and other system processes are started
  232. # with a zero umask value, so that world-writable files may be produced.
  233. # It is a good idea to edit your /etc/rc* files so that they begin with
  234. # an explicit umask setting.  On our site we use `umask 022' because it
  235. # does not break anything yet gives adequate protection against tampering.
  236. # The following macro specifies the default umask for processes run under
  237. # control of the daemon wrappers. Comment it out only if you are certain
  238. # that inetd and its children are started with a safe umask value.
  239.  
  240. UMASK    = -DDAEMON_UMASK=022
  241.  
  242. #######################################
  243. # Turning off access control (Optional)
  244. #
  245. # By default, host access control is enabled.  To disable host access
  246. # control, comment out the following definition.  Host access control
  247. # can also be turned off at runtime by providing no or empty access
  248. # control tables.
  249.  
  250. ACCESS    = -DHOSTS_ACCESS
  251.  
  252. ########################################################
  253. # Changing the access control table pathnames (Optional)
  254. #
  255. # The HOSTS_ALLOW and HOSTS_DENY macros define where the programs will
  256. # look for access control information. Watch out for the quotes and
  257. # backslashes when you make changes.
  258.  
  259. TABLES    = -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\"
  260.  
  261. ###########################################
  262. # Turning off host NAME checking (Optional)
  263. #
  264. # By default, the software tries to protect against hosts that claim to
  265. # have someone elses host name. This is relevant for network services
  266. # whose authentication depends on host names, such as rsh and rlogin.
  267. #
  268. # With paranoid mode on, connections will be rejected when the host name
  269. # does not match the host address. Connections will also be rejected when
  270. # the host name cannot be verified because gethostbyname() fails.
  271. #
  272. # Comment out the following definition if you do not need this additional
  273. # protection. If paranoid mode is off, and a host name check fails, the
  274. # daemon wrappers will use only the host address, but your daemons may
  275. # still use the host name.
  276.  
  277. PARANOID= -DPARANOID
  278.  
  279. #############################################
  280. # Turning on host ADDRESS checking (Optional)
  281. #
  282. # Optionally, the software tries to protect against hosts that pretend to
  283. # have someone elses host address. This is relevant for network services
  284. # whose authentication depends on host names, such as rsh and rlogin,
  285. # because the network address is used to look up the remote host name.
  286. # The protection is effective only when the offending host claims to have
  287. # a network address that lies outside its own network.
  288. #
  289. # My site has been running rlogind and rshd daemons that implement this
  290. # feature for more than 2 years, and without any ill effects.
  291. #
  292. # This feature cannot be used with SunOS 4.x because of a kernel bug in
  293. # the implementation of the getsockopt() system call. Kernel panics have
  294. # been reported for SunOS 4.1.1 and SunOS 4.1.2. Symptoms are "BAD TRAP"
  295. # and "Data fault" while executing the tcp_ctloutput() kernel function.
  296. #
  297. # Uncomment the following macro definition if your getsockopt() is OK.
  298. #
  299. # KILL_OPT= -DKILL_IP_OPTIONS
  300.  
  301. ## End configuration options
  302. ############################
  303.  
  304. CFLAGS    = -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
  305.     $(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) -DREAL_MISCD=$(REAL_MISCD) \
  306.     -DREAL_DAEMON_DIR=$(REAL_DAEMON_DIR) $(STYLE) $(KILL_OPT) \
  307.     -DSEVERITY=$(SEVERITY) $(UCHAR) $(TABLES) $(STRINGS) $(TLI)
  308.  
  309. LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o hosts_info.o \
  310.     hosts_ctl.o refuse.o percent_x.o clean_exit.o $(AUX_OBJ) \
  311.     fromhost.o fix_options.o from_sock.o from_tli.o
  312.  
  313. KIT    = README miscd.c tcpd.c fromhost.c hosts_access.c shell_cmd.c \
  314.     log_tcp.h try.c refuse.c Makefile.dist hosts_access.5 strcasecmp.c \
  315.     BLURB rfc931.c tcpd.8 hosts_info.c hosts_access.3 hosts_ctl.c \
  316.     percent_x.c options.c clean_exit.c setenv.c patchlevel.h strtok.c \
  317.     fix_options.c inet_addr_fix from_sock.c from_tli.c
  318.  
  319. LIB    = libwrap.a
  320.  
  321. $(LIB):    $(LIB_OBJ)
  322.     rm -f $(LIB)
  323.     ar $(ARFLAGS) $(LIB) $(LIB_OBJ)
  324.     $(RANLIB) $(LIB)
  325.  
  326. tcpd:    tcpd.o fromhost.o $(LIB)
  327.     $(CC) $(CFLAGS) -o $@ tcpd.o fromhost.o $(LIB) $(LIBS)
  328.  
  329. miscd:    miscd.o fromhost.o $(LIB)
  330.     $(CC) $(CFLAGS) -o $@ miscd.o fromhost.o $(LIB) $(LIBS)
  331.  
  332. try:    try.o $(LIB)
  333.     $(CC) $(CFLAGS) -o $@ try.o $(LIB) $(LIBS)
  334.  
  335. fromhost: fromhost.c log_tcp.h Makefile $(LIB)
  336.     $(CC) $(CFLAGS) -DTEST -o fromhost fromhost.c $(LIB) $(LIBS)
  337.     rm -f fromhost.o
  338.  
  339. shar:    $(KIT)
  340.     @shar $(KIT)
  341.  
  342. kit:    $(KIT)
  343.     @makekit $(KIT)
  344.  
  345. archive:
  346.     $(ARCHIVE) $(KIT)
  347.  
  348. clean:
  349.     rm -f tcpd miscd try fromhost *.[oa] core
  350.  
  351. # Enable all bells and whistles for linting.
  352.  
  353. lint: tcpd_lint miscd_lint try_lint
  354.  
  355. tcpd_lint:
  356.     lint -DFACILITY=LOG_MAIL -DHOSTS_ACCESS -DPARANOID -DNETGROUP \
  357.     -DGETPEERNAME_BUG -DDAEMON_UMASK=022 -DSEVERITY=$(SEVERITY) \
  358.     -DUSER_AT_HOST -DKILL_IP_OPTIONS -DOPTIONS_STYLE=process_options \
  359.     tcpd.c fromhost.c hosts_access.c shell_cmd.c refuse.c rfc931.c \
  360.     hosts_info.c percent_x.c clean_exit.c options.c setenv.c fix_options.c
  361.  
  362. miscd_lint:
  363.     lint -DFACILITY=LOG_MAIL -DHOSTS_ACCESS -DPARANOID -DNETGROUP \
  364.     -DGETPEERNAME_BUG -DDAEMON_UMASK=022 -DSEVERITY=$(SEVERITY) \
  365.     -DUSER_AT_HOST -DKILL_IP_OPTIONS -DOPTIONS_STYLE=process_options \
  366.     miscd.c fromhost.c hosts_access.c shell_cmd.c refuse.c rfc931.c \
  367.     hosts_info.c percent_x.c clean_exit.c options.c setenv.c fix_options.c
  368.  
  369. try_lint:
  370.     lint -DFACILITY=LOG_MAIL -DHOSTS_ACCESS -DNETGROUP try.c \
  371.     hosts_ctl.c hosts_access.c hosts_info.c percent_x.c
  372.  
  373. # Compilation dependencies.
  374.  
  375. clean_exit.o: log_tcp.h Makefile
  376. fix_options.o: log_tcp.h Makefile
  377. fromhost.o: log_tcp.h Makefile
  378. hosts_access.o: log_tcp.h Makefile
  379. hosts_ctl.o: log_tcp.h Makefile
  380. hosts_info.o: log_tcp.h Makefile
  381. miscd.o: patchlevel.h log_tcp.h Makefile
  382. options.o: log_tcp.h Makefile
  383. percent_x.o: log_tcp.h Makefile
  384. refuse.o: log_tcp.h Makefile
  385. rfc931.o: log_tcp.h Makefile
  386. shell_cmd.o: log_tcp.h Makefile
  387. tcpd.o: patchlevel.h log_tcp.h Makefile
  388. try.o: log_tcp.h Makefile
  389.